/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tramite.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.cip.esymons.tesoreria.be.SerieDocPago;

/**
 *
 * @author FreddyHIQ
 */
@Entity
@Table(name = "tra_tipo_documento")
//@NamedQueries({@NamedQuery(name = "TipoDocumento.findAll", query = "SELECT t FROM TipoDocumento t"), @NamedQuery(name = "TipoDocumento.findByTdoCodigo", query = "SELECT t FROM TipoDocumento t WHERE t.tdoCodigo = :tdoCodigo"), @NamedQuery(name = "TipoDocumento.findByTdoDesc", query = "SELECT t FROM TipoDocumento t WHERE t.tdoDesc = :tdoDesc"), @NamedQuery(name = "TipoDocumento.findByTdoTipo", query = "SELECT t FROM TipoDocumento t WHERE t.tdoTipo = :tdoTipo"), @NamedQuery(name = "TipoDocumento.findByTdomostrarIGV", query = "SELECT t FROM TipoDocumento t WHERE t.tdomostrarIGV = :tdomostrarIGV")})
public class TipoDocumento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "tdo_codigo")
    private Long tdoCodigo;
    @Basic(optional = false)
    @Column(name = "tdo_desc")
    private String tdoDesc;

    @Basic(optional = false)
    @Column(name = "tdo_valorContable")
    private String tdoValorContable;

    @Basic(optional = false)
    @Column(name = "tdo_valorSiscont")
    private String tdoValorSiscont;

    @Column(name = "tdo_mostrarIGV")
    private boolean mostrarIGV;
    @Column(name = "tdo_calcularIGV")
    private boolean calcularIGV;
    @Basic(optional = false)
    @Column(name = "tdo_verEnTramite")
    private boolean tdoVerEnTramite;
    @Basic(optional = false)
    @Column(name = "tdo_verEnTesoreriaIngresos")
    private boolean tdoVerEnTesoreriaIngresos;
    @Basic(optional = false)
    @Column(name = "tdo_verEnTesoreriaEgresos")
    private boolean tdoVerEnTesoreriaEgresos;
    @Basic(optional = false)
    @Column(name = "tdo_tieneSerie")
    private boolean tdoTieneSerie;
    @Transient
    private boolean seleccionado;
    @Transient
    private boolean soloLectura;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fkTdoCodigo", fetch = FetchType.LAZY)
    private List<SecuenciaDocumento> secuenciaDocumentoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fkTdoCodigo", fetch = FetchType.LAZY)
    private List<Documento> documentoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tdoCodigo", fetch = FetchType.LAZY)
    private List<SerieDocPago> listaSerieDocPago;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fkTdoCodigo", fetch = FetchType.LAZY)
    private List<DocRequerido> docRequeridoCollection;

    public TipoDocumento() {
    }

    public TipoDocumento(Long tdoCodigo) {
        this.tdoCodigo = tdoCodigo;
    }

    public TipoDocumento(Long tdoCodigo, String tdoDesc) {
        this.tdoCodigo = tdoCodigo;
        this.tdoDesc = tdoDesc;

    }

    public Long getTdoCodigo() {
        return tdoCodigo;
    }

    public void setTdoCodigo(Long tdoCodigo) {
        this.tdoCodigo = tdoCodigo;
    }

    public String getTdoDesc() {
        return tdoDesc;
    }

    public void setTdoDesc(String tdoDesc) {
        this.tdoDesc = tdoDesc;
    }

    public boolean isMostrarIGV() {
        return mostrarIGV;
    }

    public void setMostrarIGV(boolean mostrarIGV) {
        this.mostrarIGV = mostrarIGV;
    }

    public List<SecuenciaDocumento> getSecuenciaDocumentoCollection() {
        return secuenciaDocumentoCollection;
    }

    public void setSecuenciaDocumentoCollection(List<SecuenciaDocumento> secuenciaDocumentoCollection) {
        this.secuenciaDocumentoCollection = secuenciaDocumentoCollection;
    }

    public List<Documento> getDocumentoCollection() {
        return documentoCollection;
    }

    public void setDocumentoCollection(List<Documento> documentoCollection) {
        this.documentoCollection = documentoCollection;
    }

    public List<SerieDocPago> getListaSerieDocPago() {
        return listaSerieDocPago;
    }

    public void setListaSerieDocPago(List<SerieDocPago> listaSerieDocPago) {
        this.listaSerieDocPago = listaSerieDocPago;
    }

    public List<DocRequerido> getDocRequeridoCollection() {
        return docRequeridoCollection;
    }

    public void setDocRequeridoCollection(List<DocRequerido> docRequeridoCollection) {
        this.docRequeridoCollection = docRequeridoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tdoCodigo != null ? tdoCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoDocumento)) {
            return false;
        }
        TipoDocumento other = (TipoDocumento) object;
        if ((this.tdoCodigo == null && other.tdoCodigo != null) || (this.tdoCodigo != null && !this.tdoCodigo.equals(other.tdoCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.tramite.be.TipoDocumento[tdoCodigo=" + tdoCodigo + "]";
    }

    /**
     * @return the seleccionado
     */
    public boolean getSeleccionado() {
        return seleccionado;
    }

    /**
     * @param seleccionado the seleccionado to set
     */
    public void setSeleccionado(boolean seleccionado) {
        this.seleccionado = seleccionado;
    }

    /**
     * @return the soloLectura
     */
    public boolean isSoloLectura() {
        return soloLectura;
    }

    /**
     * @param soloLectura the soloLectura to set
     */
    public void setSoloLectura(boolean soloLectura) {
        this.soloLectura = soloLectura;
    }

    /**
     * @return the calcularIGV
     */
    public boolean isCalcularIGV() {
        return calcularIGV;
    }

    /**
     * @param calcularIGV the calcularIGV to set
     */
    public void setCalcularIGV(boolean calcularIGV) {
        this.calcularIGV = calcularIGV;
    }

    /**
     * @return the tdoVerEnTramite
     */
    public boolean isTdoVerEnTramite() {
        return tdoVerEnTramite;
    }

    /**
     * @param tdoVerEnTramite the tdoVerEnTramite to set
     */
    public void setTdoVerEnTramite(boolean tdoVerEnTramite) {
        this.tdoVerEnTramite = tdoVerEnTramite;
    }

    /**
     * @return the tdoVerEnTesoreriaIngresos
     */
    public boolean isTdoVerEnTesoreriaIngresos() {
        return tdoVerEnTesoreriaIngresos;
    }

    /**
     * @param tdoVerEnTesoreriaIngresos the tdoVerEnTesoreriaIngresos to set
     */
    public void setTdoVerEnTesoreriaIngresos(boolean tdoVerEnTesoreriaIngresos) {
        this.tdoVerEnTesoreriaIngresos = tdoVerEnTesoreriaIngresos;
    }

    /**
     * @return the tdoVerEnTesoreriaEgresos
     */
    public boolean isTdoVerEnTesoreriaEgresos() {
        return tdoVerEnTesoreriaEgresos;
    }

    /**
     * @param tdoVerEnTesoreriaEgresos the tdoVerEnTesoreriaEgresos to set
     */
    public void setTdoVerEnTesoreriaEgresos(boolean tdoVerEnTesoreriaEgresos) {
        this.tdoVerEnTesoreriaEgresos = tdoVerEnTesoreriaEgresos;
    }

    /**
     * @return the tdoTieneSerie
     */
    public boolean isTdoTieneSerie() {
        return tdoTieneSerie;
    }

    /**
     * @param tdoTieneSerie the tdoTieneSerie to set
     */
    public void setTdoTieneSerie(boolean tdoTieneSerie) {
        this.tdoTieneSerie = tdoTieneSerie;
    }

    /**
     * @return the tdoValorContable
     */
    public String getTdoValorContable() {
        return tdoValorContable;
    }

    /**
     * @param tdoValorContable the tdoValorContable to set
     */
    public void setTdoValorContable(String tdoValorContable) {
        this.tdoValorContable = tdoValorContable;
    }

    /**
     * @return the tdoValorSiscont
     */
    public String getTdoValorSiscont() {
        return tdoValorSiscont;
    }

    /**
     * @param tdoValorSiscont the tdoValorSiscont to set
     */
    public void setTdoValorSiscont(String tdoValorSiscont) {
        this.tdoValorSiscont = tdoValorSiscont;
    }

}
